<!-- 能耗 -->
<template>
  <div ref="chartContainer" style="width: 500px; height: 500px"></div>
</template>
  
  <script>
import * as echarts from 'echarts'
import EchartsConfig from './index.json'
import { ref, onMounted } from 'vue'

export default {
  name: 'EchartsNav',
  setup() {
    // echarts 初始化定义数据
    const chartContainer = ref(null)

    // 页面生成后调用函数
    onMounted(() => {
      // 初始化ECharts图表
      const myChart = echarts.init(chartContainer.value)
      myChart.setOption(EchartsConfig.template[0])
    })

    return {
      chartContainer
    }
  }
}
</script>
  
  <style lang="less" scoped>
</style>
  